﻿/******************************************************************************
 * 
 * Announce: CSharpKit, Basic algorithms, components and definitions.
 *           Copyright (C) ShenYongchen.
 *           All rights reserved.
 *   Author: 申永辰.郑州 (shenyczz@163.com)
 *  WebSite: http://gitee.com/shenyczz/csharp_csk
 *
 * THIS CODE IS LICENSED UNDER THE MIT LICENSE (MIT).
 * THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 
 * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
 * IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
 * PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
 * 
******************************************************************************/
using System;
using System.IO;
using System.Runtime.InteropServices;

namespace CSharpKit.Native.ECCODES
{
    // \defgroup handling_coded_messages Handling coded messages
    // Handling coded messages (处理编码消息)
    partial class eccodes
    {
        /// <summary>
        /// 原型: int codes_get_message(const codes_handle* h, const void** message, size_t* message_length); <br/>
        /// 功能: getting the message attached to a handle <br/>
        /// 状态:  <br/>
        /// </summary>
        /// <param name="codes_handle"> the handle to which the buffer should be gathered </param>
        /// <param name="message"> the pointer to be set to the handle's data </param>
        /// <param name="message_length"> On exit, the message size in number of bytes </param>
        /// <returns> 0 if OK, integer value on error </returns>
        [DllImport(_dllname_, CharSet = CharSet.Auto, EntryPoint = "codes_get_message")]
        public extern static int codes_get_message(IntPtr codes_handle, IntPtr message, out int message_length);


        /**
        * 
        *
        * @param h              : 
        * @param message        : 
        * @param message_length : 
        *                         
        * @return            0 if OK, integer value on error
*/
        /// <summary>
        /// 原型: int codes_get_message_copy(const codes_handle* h, void* message, size_t* message_length); <br/>
        /// 功能: getting a copy of the message attached to a handle. <br/>
        /// 状态:  <br/>
        /// </summary>
        /// <param name="codes_handle"> the handle to which the buffer should be returned </param>
        /// <param name="message"> the pointer to the data buffer to be filled </param>
        /// <param name="message_length">
        ///   On entry, the size in number of bytes of the allocated empty message.
        ///   On exit, the actual message length in number of bytes
        /// </param>
        /// <returns> </returns>
        [DllImport(_dllname_, CharSet = CharSet.Auto, EntryPoint = "codes_get_message_copy")]
        public extern static int codes_get_message_copy(IntPtr codes_handle, IntPtr message, ref int message_length);
        

        // {{END}}
    }

}
